package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);unique;not null;comment:用户名"`
	Password string `gorm:"type:char(32);not null;comment:密码"`
	Mobile   string `gorm:"type:char(11);not null;comment:手机号"`
	Email    string `gorm:"type:varchar(100);not null;comment:邮箱"`
}

func (u *User) UpdateAvatar(avatar string) error {
	return db.Model(&u).Update("avatar", avatar).Error

}
